import request from "@/utils/request.js"

const API = {
  SAVE: '/product',
  DELETE: '/product',
  UPDATE: '/product',
  BAN: '/product/ban',
  PAGE: '/product/page',
  LIST: '/product/list/name',
}

export const reqSave = (param) => request.post(API.SAVE, param)
export const reqDelete = (id) => request.delete(API.DELETE, {params: {id}})
export const reqUpdate = (param) => request.put(API.UPDATE, param)
export const reqBan = (id, banFlag) => request.put(API.BAN, null, {params: {id, banFlag}})
export const reqPage = (pn, ps, name) => request.get(API.PAGE, {params: {pn, ps, name}})
export const reqNameList = () => request.get(API.LIST)
